# Author:Zhang Yu

import queue
import random
import threading
import time
q = queue.Queue(maxsize=10)
q.full()

def producer(name):
    count = 1
    while True:
        q.put("骨头 %s" %count)
        print("%s制作了一个骨头%d" %(name,count))
        count += 1


def consumer(name):
    while True:
        if q.qsize() > 0 :
            print("%s 吃了一个 %s"%(name,q.get()))
            time.sleep(1)


p =threading.Thread(target=producer,args=("厨师A",))
c =threading.Thread(target=consumer,args=("小哈",))
p.start()
c.start()